﻿
using System.Collections;

namespace Xacml.Core.Context
{
  public class AttributeCollectionReadWrite : CollectionBase
  {
    public virtual AttributeElementReadWrite this[int index]
    {
      get
      {
        return (AttributeElementReadWrite) this.List[index];
      }
      set
      {
        this.List[index] = (object) value;
      }
    }

    public virtual int Add(AttributeElementReadWrite value)
    {
      return this.List.Add((object) value);
    }

    public new virtual void Clear()
    {
      base.Clear();
    }

    public new virtual void RemoveAt(int index)
    {
      base.RemoveAt(index);
    }

    public int GetIndex(AttributeElementReadWrite attribute)
    {
      for (int index = 0; index < this.Count; ++index)
      {
        if (this.List[index] == attribute)
          return index;
      }
      return -1;
    }
  }
}
